<?php
	require "settings/config.php";
	require "layout.php";
	require "includes/session.php";
	require "includes/sql_functions.php";
	require "includes/slot_functions.php";
	require "includes/game_functions.php";
	require "includes/scen_functions.php";
	require "includes/misc_functions.php";
	require "includes/signup_functions.php";
	
	if(!oh_is_logged_in())
	{
		header('Location: login.php');
		die();
	}
	
	$result=check_can_signup_as_player($_SESSION['user_id']);
	
	if($result=="CLEAR")
	{
		render_header("Game Signup");
	
		if($_GET['game'])
		{
			echo "<form action=\"do_gamereg.php\" method=\"POST\">\n";
			echo "<input type=\"hidden\" name=\"game\" value=\"".$_GET['game']."\">\n";
			echo "Your character's primary class:";
			oh_render_role_dropdown();
			echo "<br />\n";
			echo "<br />\n";
			echo "Your character's level:";
			oh_render_level_dropdown($_GET['game']);
			echo "<br />\n";
			echo "<br />\n";
			echo "<input type=\"submit\" class=\"button\" value=\"Complete Signup\">\n";
			echo "</form>";
			echo "</div>";
		}
	}
	else if ($result=="NOT_CLEAR") 
	{
		header ('Location: gameinfo.php?game='.$_GET['game'].'&notclear=1');
	}
	else if ($result=="MUST_GM") 
	{
		header ('Location: gameinfo.php?game='.$_GET['game'].'&mustgm=1');
	}
	
	render_footer();
?>
